﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SuperX.Common
{
    /// <summary>
    /// 值变化参数
    /// </summary>    
    public class TagChangedEventArgs : EventArgs
    {
        // 
        public ITag Tag { get; set; }

        // 值变化类型
        public ValueChangedType EventType { get; set; }

        // 旧值
        public object OldValue { get; set; }

        // 值
        public object Value { get; set; }

        // 
        public string UpdateSourceName { get; set; }

        // 
        public TagChangedEventArgs(ITag tag)
        {
            this.Tag = tag;
        }

        // 
        public TagChangedEventArgs(ITag tag, ValueChangedType eventType, object oldValue, object value, string updateSourceName = "")
        {
            this.Tag = tag;
            this.EventType = eventType;
            this.OldValue = oldValue;
            this.Value = value;
            this.UpdateSourceName = updateSourceName;
        }
    }
}
